<?php
class Atur_subsidi extends CI_Model 
{

	function __construct()
	{
		parent::__construct();
	}

	function subsidi()
	{
		$this->db->select('*');
		$this->db->from('a_subsidi');
		$this->db->join('m_instansi','m_instansi.id_m_instansi = a_subsidi.id_m_instansi');
		$this ->db->order_by('tgl_terima');

		$query = $this->db->get();		
		return $query->result();
	}

	function save($dataInsert)
	{
		$query = $this->db->insert('a_subsidi', $dataInsert);
		return $query;
	}

	function delete($id_a_subsidi)
	{
		$this->db->where('id_a_subsidi', $id_a_subsidi);
		$delete = $this->db->delete('a_subsidi');
		return $delete;
	}
}